#ifndef BYCSDN_H
#define BYCSDN_H

#include <QWebEngineProfile>
#include <QWebEngineScript>
#include <QWebEngineScriptCollection>
#include <QWebEngineView>

#include <qrcutil.h>

#define LINKWIKICSDN(a,x,y,z)   \
    LINKWIKI(a,x,y,z)\
class a##ByCsdn : public a { \
    public: \
    WIKI_NO_CONTENT \
    void content_item(const QListWidgetItem *item, QWebEngineView *view) override \
    { \
        view->load(prefix() + item->data(990).toString()); \
         \
        QWebEngineProfile *profile = view->page()->profile(); \
        QWebEngineScriptCollection *scripts = profile->scripts(); \
        QWebEngineScript self; \
        self.setSourceCode(QR(":/scripts/scripts/csdn.js")); \
        scripts->insert(self); \
    } \
};

#endif // BYCSDN_H
